<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    const old_obj = {
        a: 1,
        b: 'bb',
        c: new Date(),
        // d: function d(){},
        e: [1,2,3]
    }

    const worker = new Worker('work.js')
    worker.postMessage(old_obj)
    worker.onmessage = function(message){
        const new_obj = message.data
        new_obj.a = 111
        console.log(old_obj)
        console.log(new_obj)
    }
    </script>
</body>
</html>